package org.xukai.common.spel;

import java.io.Serializable;

/**
 * 字段配置
 * @author JackyLIU
 *
 */
public class FieldConfig<T> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -36606964116916886L;

	/**
	 * 字段所在的领域类信息
	 */
	private Class<T> domainClazz;
	
	/**
	 * 领域名称
	 */
	private String domainName;
	
	/**
	 * 键值名称
	 */
	private String key;
	
	/**
	 * 键值名称所对应的领域的字段名称，一般领域为POJO的领域模型，例如模型中有个字段为name，那么这个fieldName应该为name
	 */
	private String fieldName;

	/**
	 * 作为fieldName替补的字段
	 * 当fieldName为null或者""时，使用该字段进行取值
	 */
	private String subFieldName;

	public FieldConfig(){
		
	}
	
	public FieldConfig(Class<T> domainClazz, String domainName, String key, String fieldName){
		this.domainClazz = domainClazz;
		this.domainName = domainName;
		this.key = key;
		this.fieldName = fieldName;
	}

	public FieldConfig(Class<T> domainClazz, String domainName, String key, String fieldName, String subFieldName) {
		this.domainClazz = domainClazz;
		this.domainName = domainName;
		this.key = key;
		this.fieldName = fieldName;
		this.subFieldName = subFieldName;
	}

	public Class<T> getDomainClazz() {
		return domainClazz;
	}

	public void setDomainClazz(Class<T> domainClazz) {
		this.domainClazz = domainClazz;
	}

	public String getDomainName() {
		return domainName;
	}

	public void setDomainName(String domainName) {
		this.domainName = domainName;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public String getSubFieldName() {
		return subFieldName;
	}

	public void setSubFieldName(String subFieldName) {
		this.subFieldName = subFieldName;
	}

}
